function feat = Gen_Image_Feature(img)
%imsz = [128 48]; % set the image size.
% Input： img: h*w*3
imsz = [size(img,1),size(img,2)];
grid_step = 4; 
patch_size = 16;
step = [grid_step grid_step];
BBoxsz =[patch_size patch_size]; % set the region size.
[region_idx,nx,ny, sBBox] =GenerateGridBBox(imsz, BBoxsz,step); % by columns: Move Y first
PatchFeature=[];
pNum = 1;
for b = 1:size(sBBox,1)
    PatchFeature(:,pNum) = Gen_Patch_Feature(imcrop(img,[sBBox(b,1) sBBox(b,2) patch_size-1,patch_size-1]),16);
    pNum = pNum + 1;
end
feat = PatchFeature(:);

